/*
 * Ant Group
 * Copyright (c) 2004-2024 All Rights Reserved.
 */
package com.alipay.zmdepositdemo.controller;

import com.alipay.api.response.AlipayFundAuthOperationDetailQueryResponse;
import com.alipay.zmdepositdemo.model.OpenResponse;
import com.alipay.zmdepositdemo.service.manage.DepositOrderManageService;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 查询免押订单
 *
 * @author zhangjian
 * @version DepositOrderQueryController.java, v 0.1 2024年07月04日 14:23 zhangjian
 */
@Api(tags = "查询免押订单")
@ApiSupport(order = 2)
@RestController
@RequestMapping(value = "/query-deposit-order")
public class DepositOrderQueryController {

    @Autowired
    private DepositOrderManageService depositOrderManageService;

    /**
     * 查询免押订单
     *
     * @see
     * <a href="https://opendocs.alipay.com/open/306c2ebb_alipay.fund.auth.operation.detail.query?scene=common&pathHash=0d924af7">...</a>
     */
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "查询免押订单接口")
    @GetMapping(value = "/query")
    public OpenResponse<AlipayFundAuthOperationDetailQueryResponse> queryOrder(
            @ApiParam(value = "支付宝授权资金订单号") @RequestParam(required = false) String authNo,
            @ApiParam(value = "商户授权资金订单号") @RequestParam(required = false) String outOrderNo,
            @ApiParam(value = "支付宝授权资金操作流水号") @RequestParam(required = false) String operationId,
            @ApiParam(value = "商户授权资金操作流水号") @RequestParam(required = false) String outRequestNo,
            @ApiParam(value = "授权资金操作类型", defaultValue = "FREEZE") @RequestParam(required = false) String operationType) {
        return depositOrderManageService.queryOrder(authNo, outOrderNo, operationId, outRequestNo, operationType);
    }
}